package com.chinasoft.mall.activity;

import android.os.Bundle;
import android.widget.TextView;
import android.widget.Toast;

import com.chinasoft.mall.R;
import com.chinasoft.mall.model.response.ModelWeiboBean;
import com.chinasoft.mall.util.StringUtil;
import com.chinasoft.mall.widget.NetImageView;

/**
 * 商品详情
 * 
 * @author Administrator
 */
public class SyModelDetailActivity extends BaseActivity {
	// 将所属分类的商品全部显示出来
	private ModelWeiboBean model_weibo;
	private TextView time;
	private TextView intro;
	private TextView content;
	private NetImageView modelimg;

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.sy_modeldetail);
		init();
		initView();
	}

	private void init() {
		/*
		 * goodsimg_bb = ControllerCenter.responsdata.get(Config.GET_GOODSIMG);
		 * if (goodsimg_bb != null) { success(goodsimg_bb); } else
		 */{
			if (sz != null) {
				model_weibo = (ModelWeiboBean) sz;
			} else {
				Toast.makeText(this, "数据获取失败", Toast.LENGTH_LONG).show();
				((MainActivity) this.getParent()).backCurrentActivity(false);
			}
		}
	}

	private void initView() {
		time = (TextView) findViewById(R.id.time);
		intro = (TextView) findViewById(R.id.intro);
		content = (TextView) findViewById(R.id.content);
		modelimg = (NetImageView) findViewById(R.id.modelimg);
		time.setText(model_weibo.getPUB_DATE());
		intro.setText(model_weibo.getGOODS_KEYWORDS());
		content.setText(model_weibo.getCONTENT());
		modelimg.setDownloadurl(StringUtil.modelWeiboUrl(model_weibo.getMODEL_ID(),model_weibo.getPUB_DATE()));
	}

}
